-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Layout animations for container array'd objects #1081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to annotation-animation Conflicts: test/jasmine/tests/transition_test.js
Added test. Sorry for the messy git history. The linter strikes again. |
gd._transitionData._interruptCallbacks.push(function() { | ||
aborted = true; | ||
}); | ||
|
||
if(frameOpts.redraw) { | ||
gd._transitionData._interruptCallbacks.push(function () { | ||
return Plotly.redraw(gd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of Plotly.redraw
|
||
}).catch(fail).then(done); | ||
|
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -1510,7 +1512,7 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts) | |||
delete layoutUpdate[attr].range; | |||
} | |||
|
|||
Lib.extendDeepNoArrays(gd.layout, layoutUpdate); | |||
plots.extendLayout(gd.layout, layoutUpdate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, this now guarantees that shapes
, images
and all the other layout array container can also be animated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there are bugs, yes. It iterates through each of those container arrays as a way of bypassing the No
in extendDeepNoArrays
. The option to force redraw makes non-animatable things Just Work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Let's 🔒 this down by expanding test case
to transition all layout array containers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lunch, then adding it.
@etpinard Images took just a bit of tweaking to preserve the image element in the join. Flickered excessively otherwise... |
@etpinard Added shape and image tests. Ensured that the correct properties are modified or remain the same. Nothing too fancy or profound. Just some sanity checks. Both still need actual animation (i.e. smooth transition) support, but this is a good start. |
amazing 💃 |
@rreusser follow up question on this PR: can frames clear array containers (e.g. annotations) on |
This PR does two things:
extendLayout
function from Improved animation merging for layout and traces #1041redraw: true
weren't getting redrawn between frames due to a race condition between frame duration and transition duration. If you specifyredraw: true
, the whole plot now definitely gets redrawn between frames.Here are animated annotations. Note that they take effect at the end of the transition since smooth annotation transitions are not yet implemented. Also, two-way component binding is not merged into this branch but will work once #1016 is merged.